<%@page import="com.scrum.Object.Catalog"%>
<%@page import="com.scrum.Object.Post"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
<!-- 
<link href="../css/font-awesome.css" rel="stylesheet" type="text/css" />
<link href="../css/font-awesome.min.css" rel="stylesheet" type="text/css" />
 -->
<link href="../css/bootstrap-theme.min.css" rel="stylesheet"
	type="text/css" />
<link href="../css/bootstrap.min.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../js/jquery-2.1.1.min.js"></script>
<script type="text/javascript" src="../js/bootstrap.min.js"></script>
<script type="text/javascript" src="../js/ckeditor.js"></script>
<!-- 
<script src="../js/jquery-ui.js"></script>
<script src="../js/jquery.validate.js"></script>
 -->
</head>
<body>
<%
	int post_id = Integer.parseInt(request.getParameter("postid"));
	Post post = Post.getPostById(post_id);
%>
	<div class="container">
		<form id="update_post" method="POST" action="update_post" enctype="multipart/form-data">
			<input type="hidden" name="postid" value="<%= post_id %>"/>
			<div class="form-group">
				<input class="form-control input-lg" name="title" type="text" placeholder="Title" value="<%= post.getTitle() %>">
			</div>
			<br />
			<div class="form-group">
				<img src="../image/browse-img.png" width="200px" height="200px" /> <br />
				<br /> <br />
				<input type="file" name="browse_image" size="50" class="btn btn-primary" />
				<br />
			</div>
			<input type="hidden" value="<%= Catalog.getcatalog(post.getCatalog_id()) %>" id="catalog_str"/>
			<label>Product's Catalog</label> 
			<select class="form-control" name="catalog" id="catalog">
				<option value="en">Entertainment Places</option>
				<option value="fo">Food Places</option>
				<option value="re">Rest Places</option>
			</select> <br /> <br /> <label>Content</label>
			<textarea class="ckeditor" name="description"><%= post.getDescription() %></textarea>
			<br />
			<button type="submit" class="btn btn-default">Submit</button>
		</form>
	</div>
	<!-- /container -->
	<script>
	$(document).ready(function(){
		$("#catalog").val($("#catalog_str").val());
		
	});
	</script>
</body>
</html>